<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.2.6" />
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
  border: 1px solid red;
*/
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

tt {
  color: navy;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  font-family: sans-serif;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}

div.sectionbody {
  font-family: serif;
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}

pre {
  padding: 0;
  margin: 0;
}

span#author {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 1.1em;
}
span#email {
}
span#revision {
  font-family: sans-serif;
}

div#footer {
  font-family: sans-serif;
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
div#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
div#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

div#preamble,
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-right: 10%;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.5em;
  margin-bottom: 2.5em;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}

div.listingblock {
  margin-right: 0%;
}
div.listingblock > div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock > div.content {
  padding-left: 2.0em;
}

div.attribution {
  text-align: right;
}
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 2px solid silver;
}

div.exampleblock > div.content {
  border-left: 2px solid silver;
  padding: 0.5em;
}

div.verseblock div.content {
  white-space: pre;
}

div.imageblock div.content { padding-left: 0; }
div.imageblock img { border: 1px solid silver; }
span.image img { border-style: none; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
div.olist > ol {
  list-style-type: decimal;
}
div.olist2 > ol {
  list-style-type: lower-alpha;
}

div.tableblock > table {
  border: 3px solid #527bbd;
}
thead {
  font-family: sans-serif;
  font-weight: bold;
}
tfoot {
  font-weight: bold;
}

div.hlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hlist td {
  padding-bottom: 15px;
}
td.hlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
}
td.hlist2 {
  vertical-align: top;
}

@media print {
  div#footer-badges { display: none; }
}

div#toctitle {
  color: #527bbd;
  font-family: sans-serif;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}
/* Workarounds for IE6's broken and incomplete CSS2. */

div.sidebar-content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}
div.sidebar-title, div.image-title {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  margin-top: 0.0em;
  margin-bottom: 0.5em;
}

div.listingblock div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock-content {
  padding-left: 2.0em;
}

div.exampleblock-content {
  border-left: 2px solid silver;
  padding-left: 0.5em;
}

/* IE6 sets dynamically generated links as visited. */
div#toc a:visited { color: blue; }

/* Because IE6 child selector is broken. */
div.olist2 ol {
  list-style-type: lower-alpha;
}
div.olist2 div.olist ol {
  list-style-type: decimal;
}
</style>
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){generateToc(3)}
/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, October 2006. License: GPL */

function getText(el) {
  var text = "";
  for (var i = el.firstChild; i != null; i = i.nextSibling) {
    if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
      text += i.data;
    else if (i.firstChild != null)
      text += getText(i);
  }
  return text;
}

function TocEntry(el, text, toclevel) {
  this.element = el;
  this.text = text;
  this.toclevel = toclevel;
}

function tocEntries(el, toclevels) {
  var result = new Array;
  var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
  // Function that scans the DOM tree for header elements (the DOM2
  // nodeIterator API would be a better technique but not supported by all
  // browsers).
  var iterate = function (el) {
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
        var mo = re.exec(i.tagName)
        if (mo)
          result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
        iterate(i);
      }
    }
  }
  iterate(el);
  return result;
}

// This function does the work. toclevels = 1..4.
function generateToc(toclevels) {
  var toc = document.getElementById("toc");
  var entries = tocEntries(document.getElementsByTagName("body")[0], toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "toc" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    document.getElementById("header").removeChild(toc);
}
/*]]>*/
</script>
<title>翻译 OpenBSD 文档的方法</title>
</head>
<body>
<div id="header">
<h1>翻译 OpenBSD 文档的方法</h1>
<div id="toc">
  <div id="toctitle">目录</div>
  <noscript><p><b>为了显示目录，你的浏览器必须启用 JavaScript。</b></p></noscript>
</div>
</div>
<h2 id="_">1. 安装工具</h2>
<div class="sectionbody">
<h3 id="_iconv">1.1. iconv</h3><div style="clear:left"></div>
<div class="para"><p>iconv 用来将英文的 ISO-8859-1 编码无损转换为 UTF-8 编码。</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ cd /usr/ports/converters/libiconv
$ make install
$ iconv --version
iconv (GNU libiconv 1.9)
Copyright (C) 2000-2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Bruno Haible.</tt></pre>
</div></div>
<h3 id="_validate">1.2. validate</h3><div style="clear:left"></div>
<div class="para"><p>推荐使用 validate 校验 HTML 文档的合法性。</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ cd /usr/ports/textproc/validate
$ make install
$ validate -v
Offline HTMLHelp.com Validator, Version 1.2.2
by Liam Quinn &lt;liam@htmlhelp.com&gt;</tt></pre>
</div></div>
<div class="para"><p>但是你也可以使用 tidy(由于换行问题，其输出文件不能满足要求):</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ cd /usr/ports/www/tidy
$ make install
$ tidy -v
HTML Tidy for OpenBSD released on 1 September 2005</tt></pre>
</div></div>
<div class="para"><p>由于官方不再发布打包后的代码，所以最新的 tidy 只能从 CVS 获得:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ cvs -d :pserver:anonymous@tidy.cvs.sourceforge.net:/cvsroot/tidy co tidy
$ cd tidy/build/gmake
$ sudo gmake install
$ tidy -v
HTML Tidy for OpenBSD released on 25 January 2008</tt></pre>
</div></div>
<div class="para"><p>tidy 的配置文件:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ cat ~/tidy.conf
bare: yes
# break-before-br: yes
# doctype: transitional
drop-empty-paras: no
# drop-proprietary-attributes: yes
indent: auto
newline: LF
output-bom: no
output-encoding: utf8
output-html: yes
quiet: yes
tidy-mark: no
# wrap: 0
write-back: no</tt></pre>
</div></div>
<h3 id="_linkchecker">1.3. linkchecker</h3><div style="clear:left"></div>
<div class="para"><p>强烈建议使用 linkchecker 检查 HTML 文档是否有死链接。</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ cd /usr/ports/www/linkchecker
$ make install
$ linkchecker -V
LinkChecker 4.5              Copyright (C) 2000-2006 Bastian Kleineidam</tt></pre>
</div></div>
</div>
<h2 id="__2">2. 工作流程</h2>
<div class="sectionbody">
<h3 id="__3">2.1. 编码转换</h3><div style="clear:left"></div>
<div class="para"><p>禁止使用 GB18030/GBK/GB2312/Big5 等编码。在工作之前，
要将 HTML 文件的编码从 ISO-8859-1 转换为 UTF-8。例如:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ iconv -f ISO-8859-1 -t UTF-8 example.html &gt; zh/example.html</tt></pre>
</div></div>
<h3 id="__4">2.2. 翻译文档</h3><div style="clear:left"></div>
<div class="ilist"><ul>
<li>
<p>
准确翻译，仔细复审。
</p>
</li>
<li>
<p>
除非必要，不许增删改 HTML 标签，或者调整这些标签的顺序。
</p>
</li>
<li>
<p>
预览效果，尽量与原文的版面一致。
</p>
</li>
<li>
<p>
尽量保证行长不大于 72 个英文字符。
</p>
</li>
<li>
<p>
注意换行引入的额外空格。尽量在需要加入空格的地方或标点符号之后换行。
</p>
</li>
<li>
<p>
不许修改版权信息，包括年份。
</p>
</li>
<li>
<p>
由于<a href="http://steelix.kd85.com/translation/tagreport/#zh">标签报告</a>的问题，建议使用文本编辑器从事翻译工作。
</p>
</li>
<li>
<p>
经常浏览<a href="http://steelix.kd85.com/translation/status.html#zh">翻译状态页面</a>，及时更新。
</p>
</li>
</ul></div>
<h3 id="__5">2.3. 校验文档</h3><div style="clear:left"></div>
<div class="para"><p>校验文档的格式是否合法。例如:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt># $ sed /^[[:space:]]*$/d example.html &gt; tmp

$ validate -w --charset=utf-8 example.html</tt></pre>
</div></div>
<div class="para"><p>但是你也可以使用 tidy(由于换行问题，其输出文件不能满足要求):</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ tidy -config ~/tidy.conf -utf8 -o /dev/null example.html</tt></pre>
</div></div>
<h3 id="__6">2.4. 检查链接</h3><div style="clear:left"></div>
<div class="para"><p>使用 linkchecker 检查 HTML 文档是否有死链接。例如:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ linkchecker -r 1 example.html</tt></pre>
</div></div>
</div>
<h2 id="__7">3. 版本控制</h2>
<div class="sectionbody">
<h3 id="__8">3.1. 中文翻译版本库</h3><div style="clear:left"></div>
<div class="para"><p>中文翻译小组使用 <a href="http://hg.sharesource.org/g11n/">sharesource</a> 作为主要版本库，
定期同步到 <a href="http://code.google.com/p/i18n-zh/">i18n-zh</a>
和 <a href="http://code.google.com/p/openbsdonly/">openbsdonly</a> 的版本库中。</p></div>
<div class="para"><p>在完成翻译，通过各种检查后，由 <a href="http://code.google.com/p/i18n-zh/">i18n-zh</a>
小组将文档提交到位于 steelix.kd85.com 的 CVS 版本库，然后回写 CVS 标签到
<a href="http://hg.sharesource.org/g11n/">sharesource</a>，可能还有
<a href="http://code.google.com/p/i18n-zh/">i18n-zh</a> 和
<a href="http://code.google.com/p/openbsdonly/">openbsdonly</a> 的版本库中。<br /></p></div>
<div class="para"><p>从匿名 CVS 服务器更新 sharesource 的英文版本：</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>WC_CVS=/usr/www
WC_HG=/home/dongsheng/wc/hg/g11n

# for i in . faq faq/pf openbgpd opencvs openntpd openssh papers porting spamd; do
#     /bin/rm ${WC_CVS}/${i}/*.html
# done
# cd ${WC_CVS} &amp;&amp; cvs up

for i in . faq faq/pf openbgpd opencvs openntpd openssh papers porting spamd; do
    /bin/cp ${WC_CVS}/${i}/*.html ${WC_HG}/os/OpenBSD/www/${i}
done

cd ${WC_HG}/os/OpenBSD/www/ &amp;&amp; hg purge -f .
# cd ${WC_HG}/os/OpenBSD/www/ &amp;&amp; hg ci -m "Sync with AnonCVS" .</tt></pre>
</div></div>
<h3 id="_openbsd">3.2. OpenBSD 翻译版本库</h3><div style="clear:left"></div>
<div class="para"><p>目前官方版本库不对翻译人员开放。</p></div>
<div class="para"><p>在 steelix.kd85.com 有一个不对外提供匿名 CVS 服务的翻译版本库。翻译人员在取得
账户后，可以提交到此版本库中。然后统一由翻译协调者将所有语言的翻译同步到官方
版本库中。</p></div>
<h3 id="_steelix">3.3. 从 steelix 检出</h3><div style="clear:left"></div>
<div class="para"><p>对于 steelix 的文档，不需要全部检出，只检出我们需要的部分即可。首先执行非递归检出，例如：</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>cd /home/dongsheng/wc
cvs -d dongsheng@steelix.kd85.com:/cvs co -l -d steelix-www www</tt></pre>
</div></div>
<div class="para"><p>然后就可以执行非递归更新了，例如只检出/更新当前翻译相关部分：</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>cd /home/dongsheng/wc/steelix-www

cvs up -l images
cvs up -l zh
cvs up -l opencvs
cvs up -l opencvs/images
cvs up -l opencvs/zh
cvs up -l faq
cvs up -l faq/images
cvs up -l faq/zh
cvs up -l faq/pf
cvs up -l faq/pf/zh
cvs up -l spamd
cvs up -l spamd/zh</tt></pre>
</div></div>
<h3 id="_steelix_2">3.4. 提交到 steelix</h3><div style="clear:left"></div>
<div class="para"><p>从 sharesource 提交到 steelix 后，再向 sharesource 同步 CVS 标签。</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>WC_CVS=/home/dongsheng/wc/steelix-www
WC_HG=/home/dongsheng/wc/hg/g11n

for i in zh opencvs/zh faq/zh faq/pf/zh spamd/zh; do
    /bin/cp ${WC_HG}/os/OpenBSD/www/${i}/*.html ${WC_CVS}/${i}
done

cd ${WC_CVS} &amp;&amp; cvs ci -m "Sync with http://hg.sharesource.org/g11n/"

for i in zh opencvs/zh faq/zh faq/pf/zh spamd/zh; do
    /bin/cp ${WC_CVS}/${i}/*.html  ${WC_HG}/os/OpenBSD/www/${i}
done

cd ${WC_HG} &amp;&amp; hg ci -m "Sync CVS Tags"</tt></pre>
</div></div>
</div>
<h2 id="__9">4. 加入我们</h2>
<div class="sectionbody">
<div class="para"><p>如果大家发现问题，请先检查 <a href="http://hg.sharesource.org/g11n/">sharesource</a>
中的文件。如果发现 <a href="http://hg.sharesource.org/g11n/">sharesource</a>
中的文件仍旧有此问题，参看 <a href="http://hg.sharesource.org/g11n/">sharesource</a>
中的版本信息，将问题或补丁发给 <a href="http://code.google.com/p/i18n-zh/">i18n-zh</a>
的<a href="http://groups.google.com/group/i18n-zh/">讨论组</a>或译者。</p></div>
<div class="para"><p>如果你有兴趣参加，请在 <a href="http://code.google.com/p/i18n-zh/">i18n-zh</a>
的<a href="http://groups.google.com/group/i18n-zh/">讨论组</a>发言。在提交数个网页的合
格翻译后，会被授予 <a href="http://hg.sharesource.org/g11n/">sharesource</a> 的写权限。</p></div>
</div>
<div id="footer">
<div id="footer-text">
最后更新于 2008-04-30 02:48:31 +0000
</div>
</div>
</body>
</html>
